package com.mt.restaurant.dao.material;

import com.mt.common.core.web.base.PageDTO;
import com.mt.common.core.web.base.PageResultDTO;
import com.mt.restaurant.entity.material.SupplyMaterial;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;
import org.apache.ibatis.annotations.Param;
import java.util.List;

@Mapper
@Component(value = "supplyMaterialDao")
public interface SupplyMaterialDao {

    /**
    * 根据分页参数查询供应原材料集合
    *
    * @param pageDTO 分页条件
    */
    public List<SupplyMaterial> findSupplyMaterials(PageDTO pageDTO);

    /**
    * 查询全部供应原材料集合
    *
    */
    public List<SupplyMaterial> findAllSupplyMaterials();

    /**
    * 查询所有供应原材料集合(只提取ID 和 Name)
    *
    */
    public List<SupplyMaterial> findAllSupplyMaterialsWithIdName();

    /**
    * 根据名称查询供应原材料集合(只提取ID 和 Name)
    *
    * @param supplyMaterialName 名称
    */
    public List<SupplyMaterial> findSupplyMaterialsWithIdNameByName(@Param("supplyMaterialName") String supplyMaterialName);

    /**
    * 根据ID查询指定的供应原材料(只提取ID 和 Name)
    *
    * @param supplyMaterialId Id
    */
    public SupplyMaterial findSupplyMaterialsWithIdNameById(@Param(" supplyMaterialId") Long supplyMaterialId);

    /**
    * 根据分页参数查询供应原材料集合的数量
    *
    * @param pageDTO 分页条件
    */
    public Long findSupplyMaterialTotalCount(PageDTO pageDTO);

    /**
    * 根据ID查询指定的供应原材料
    *
    * @param supplyMaterialId Id
    */
    public SupplyMaterial findSupplyMaterial(@Param("supplyMaterialId") Long supplyMaterialId);

    /**
    * 根据ID查询指定的供应原材料(包含外键)
    *
    * @param supplyMaterialId Id
    */
    public SupplyMaterial findSupplyMaterialWithForeignName(@Param("supplyMaterialId") Long supplyMaterialId);

    /**
    * 新增供应原材料
    *
    * @param supplyMaterial 实体对象
    */
    public Long saveSupplyMaterial(SupplyMaterial supplyMaterial);

    /**
    * 更新供应原材料
    *
    * @param supplyMaterial 实体对象
    */
    public Long updateSupplyMaterial(SupplyMaterial supplyMaterial);

    public Long updateSupplyMaterialFailuresNum(Long supplyMaterialId);

    /**
    * 根据ID删除供应原材料
    *
    * @param supplyMaterialId ID
    */
    public Long deleteSupplyMaterial(@Param("supplyMaterialId") Long supplyMaterialId);
}
